
package com.base.data.elasticsearch.repository;

import com.base.data.elasticsearch.core.query.BaseSearchQuery;
import org.elasticsearch.index.query.QueryBuilder;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.repository.NoRepositoryBean;

import java.io.Serializable;

/**
 * @param <T>
 * @param <ID>
 */
@NoRepositoryBean
public interface BaseElasticsearchRepository<T, ID extends Serializable> extends BaseElasticsearchCrudRepository<T, ID> {

	//done
	<S extends T> S index(S entity);
	//done
	Iterable<T> search(QueryBuilder query);
	//done
	Page<T> search(QueryBuilder query, Pageable pageable);
	//done
	Page<T> search(BaseSearchQuery searchQuery);

//	Page<T> searchSimilar(T entity, String[] fields, Pageable pageable);

	Class<T> getEntityClass();
}
